﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbGripData : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbGripData(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbGripData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbGripData()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbGripData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdDbGripData() : this(TD_DbPINVOKE.new_OdDbGripData__SWIG_0(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbGripData(OdDbGripData arg0) : this(TD_DbPINVOKE.new_OdDbGripData__SWIG_1(OdDbGripData.getCPtr(arg0)), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbGripData(OdGePoint3d pt, IntPtr AppData, GripOperationDelegate hotGrip, GripOperationDelegate hoverGrip, GripRtClkHandlerDelegate RtClk, GripWorldDrawDelegate wd, GripViewportDrawDelegate vd, GripOpStatusDelegate stat, GripToolTipDelegate tt, GripDimensionDelegate hoverDim, GripDimensionDelegate hotGripDim, uint bitFlags, OdGePoint3d altBasePt, GripInputPointDelegate inputPointFunc) : this(TD_DbPINVOKE.new_OdDbGripData__SWIG_2(OdGePoint3d.getCPtr(pt), AppData, hotGrip, hoverGrip, RtClk, wd, vd, stat, tt, hoverDim, hotGripDim, bitFlags, OdGePoint3d.getCPtr(altBasePt), inputPointFunc), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbGripData(OdGePoint3d pt, IntPtr AppData, OdRxClass pAppDataClass, GripOperationDelegate hotGrip, GripOperationDelegate hoverGrip, GripRtClkHandlerDelegate RtClk, GripWorldDrawDelegate wd, GripViewportDrawDelegate vd, GripOpStatusDelegate stat, GripToolTipDelegate tt, GripDimensionDelegate hoverDim, GripDimensionDelegate hotGripDim, uint bitFlags, OdGePoint3d altBasePt, GripInputPointDelegate inputPointFunc) : this(TD_DbPINVOKE.new_OdDbGripData__SWIG_3(OdGePoint3d.getCPtr(pt), AppData, OdRxClass.getCPtr(pAppDataClass), hotGrip, hoverGrip, RtClk, wd, vd, stat, tt, hoverDim, hotGripDim, bitFlags, OdGePoint3d.getCPtr(altBasePt), inputPointFunc), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setAllData(OdGePoint3d pt, IntPtr AppData, GripOperationDelegate hotGrip, GripOperationDelegate hoverGrip, GripRtClkHandlerDelegate RtClk, GripWorldDrawDelegate wd, GripViewportDrawDelegate vd, GripOpStatusDelegate stat, GripToolTipDelegate tt, GripDimensionDelegate hoverDim, GripDimensionDelegate hotGripDim, uint bitFlags, OdGePoint3d altBasePt, GripInputPointDelegate inputPointFunc, OdRxClass pAppDataClass)
		{
			TD_DbPINVOKE.OdDbGripData_setAllData(this.swigCPtr, OdGePoint3d.getCPtr(pt), AppData, hotGrip, hoverGrip, RtClk, wd, vd, stat, tt, hoverDim, hotGripDim, bitFlags, OdGePoint3d.getCPtr(altBasePt), inputPointFunc, OdRxClass.getCPtr(pAppDataClass));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbGripData Assign(OdDbGripData arg0)
		{
			OdDbGripData result = new OdDbGripData(TD_DbPINVOKE.OdDbGripData_Assign(this.swigCPtr, OdDbGripData.getCPtr(arg0)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d gripPoint()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbGripData_gripPoint(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGripPoint(OdGePoint3d pt)
		{
			TD_DbPINVOKE.OdDbGripData_setGripPoint(this.swigCPtr, OdGePoint3d.getCPtr(pt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr appData()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_appData(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAppData(IntPtr pAppData)
		{
			TD_DbPINVOKE.OdDbGripData_setAppData(this.swigCPtr, pAppData);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdRxClass appDataOdRxClass()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbGripData_appDataOdRxClass(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAppDataOdRxClass(OdRxClass pClass)
		{
			TD_DbPINVOKE.OdDbGripData_setAppDataOdRxClass(this.swigCPtr, OdRxClass.getCPtr(pClass));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr hotGripFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_hotGripFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHotGripFunc(GripOperationDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setHotGripFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr hoverFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_hoverFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHoverFunc(GripOperationDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setHoverFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr worldDraw()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_worldDraw(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setWorldDraw(GripWorldDrawDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setWorldDraw(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr viewportDraw()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_viewportDraw(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setViewportDraw(GripViewportDrawDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setViewportDraw(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr gripOpStatFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_gripOpStatFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGripOpStatFunc(GripOpStatusDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setGripOpStatFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr toolTipFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_toolTipFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setToolTipFunc(GripToolTipDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setToolTipFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d alternateBasePoint()
		{
			IntPtr intPtr = TD_DbPINVOKE.OdDbGripData_alternateBasePoint(this.swigCPtr);
			OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setAlternateBasePoint(OdGePoint3d altBasePt)
		{
			TD_DbPINVOKE.OdDbGripData_setAlternateBasePoint(this.swigCPtr, OdGePoint3d.getCPtr(altBasePt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public uint bitFlags()
		{
			uint result = TD_DbPINVOKE.OdDbGripData_bitFlags(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBitFlags(uint flags)
		{
			TD_DbPINVOKE.OdDbGripData_setBitFlags(this.swigCPtr, flags);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool skipWhenShared()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_skipWhenShared(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setSkipWhenShared(bool skip)
		{
			TD_DbPINVOKE.OdDbGripData_setSkipWhenShared(this.swigCPtr, skip);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isRubberBandLineDisabled()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_isRubberBandLineDisabled(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void disableRubberBandLine(bool disable)
		{
			TD_DbPINVOKE.OdDbGripData_disableRubberBandLine(this.swigCPtr, disable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool areModeKeywordsDisabled()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_areModeKeywordsDisabled(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void disableModeKeywords(bool disable)
		{
			TD_DbPINVOKE.OdDbGripData_disableModeKeywords(this.swigCPtr, disable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool drawAtDragImageGripPoint()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_drawAtDragImageGripPoint(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDrawAtDragImageGripPoint(bool atDragPoint)
		{
			TD_DbPINVOKE.OdDbGripData_setDrawAtDragImageGripPoint(this.swigCPtr, atDragPoint);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool triggerGrip()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_triggerGrip(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTriggerGrip(bool trigger)
		{
			TD_DbPINVOKE.OdDbGripData_setTriggerGrip(this.swigCPtr, trigger);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool forcedPickOn()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_forcedPickOn(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setForcedPickOn(bool on)
		{
			TD_DbPINVOKE.OdDbGripData_setForcedPickOn(this.swigCPtr, on);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool mapGripHotToRtClk()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_mapGripHotToRtClk(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setMapGripHotToRtClk(bool on)
		{
			TD_DbPINVOKE.OdDbGripData_setMapGripHotToRtClk(this.swigCPtr, on);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool gizmosEnabled()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_gizmosEnabled(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGizmosEnabled(bool on)
		{
			TD_DbPINVOKE.OdDbGripData_setGizmosEnabled(this.swigCPtr, on);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool gripIsPerViewport()
		{
			bool result = TD_DbPINVOKE.OdDbGripData_gripIsPerViewport(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setGripIsPerViewport(bool on)
		{
			TD_DbPINVOKE.OdDbGripData_setGripIsPerViewport(this.swigCPtr, on);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr hoverDimensionFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_hoverDimensionFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHoverDimensionFunc(GripDimensionDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setHoverDimensionFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr hotGripDimensionFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_hotGripDimensionFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHotGripDimensionFunc(GripDimensionDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setHotGripDimensionFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr rtClk()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_rtClk(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setRtClk(GripRtClkHandlerDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setRtClk(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public IntPtr inputPointFunc()
		{
			IntPtr result = TD_DbPINVOKE.OdDbGripData_inputPointFunc(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setInputPointFunc(GripInputPointDelegate pf)
		{
			TD_DbPINVOKE.OdDbGripData_setInputPointFunc(this.swigCPtr, pf);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
